'''
Created on 2017-6-20

@author: 24253
'''
import threading
from zs.content.xiaomi import xiaomi
from zs.hook.hook import XiaomiHook
from zs.path.path import XiaomiPath
class CrawerMain(object):
    
    def run(self):
        self.runxiaomi()
        
        
    def runxiaomi(self):
        
        threads = []
        homeurl ="https://s.taobao.com/search?data-key=s&data-value=0&ajax=true&_ksTS=1497949320246_1376&q=%E5%B0%8F%E7%B1%B36&imgfile=&js=1&stats_click=search_radio_all:1&initiative_id=staobaoz_20170620&ie=utf8&app=detailproduct&through=1&bcoffset=4&p4ppushleft=6,48"
        threadAnum = 4
        threadBnum = 8
        threadCnum = 4
        for i in range(0,threadAnum):
            t = threading.Thread(target=XiaomiHook(homeurl).run)
            threads.append(t)
            
        for i in range(0,threadBnum):
            t = threading.Thread(target=XiaomiPath().run)
            threads.append(t)
            
        for i in range(0,threadCnum):
            t = threading.Thread(target=xiaomi().run)
            threads.append(t)
            
        for t in threads:
            t.start()
            
        